<template>
  <div>
    <button @click="isShow = !isShow">是否显示</button>
    <transition name="h1" appear>
      <h1 class="h1" v-show="isShow">UserTranstion 实现动画效果</h1>
    </transition>
  </div>
</template>

<script>
export default {
  name: 'UseTranstion',
  data() {
    return {
      isShow: true
    }
  }
}
</script>

<style lang="less" scoped>
.h1 {
  background-color: orange;
}

/** 进入的起点 */
.h1-enter, .h1-leave-to {
  transform: translateX(-100%);
}

.h1-enter-active, .h1-leave-active {
  transition: 1s;
}

/** 进入的终点 */
.h1-enter-to, .h1-leave {
  transform: translateX(0);
}

</style>